package com.lsc.study.reverse;

public class ReverseNumber {

    public static void main(String[] args) {
        int num = 12345;
        /* 定义一个可变长的字符串  */
        StringBuffer stringBuffer = new StringBuffer();

        /* 可变长字符串  */
//        StringBuffer    ;
//        StringBuilder   ;
        while (num != 0) {
            int r = num % 10;
            stringBuffer.append(r);
            num /= 10;
        }


        System.out.println(stringBuffer.toString());

        String s = stringBuffer.toString();
        System.out.println(s);

        int i = Integer.parseInt(s);
        System.out.println(i);

    }
}
